﻿@model MVC_DaLatServices.Models.Article

@{
    ViewBag.Title = "Edit";
    Layout = "~/Areas/Administrator/Views/Shared/_Layout.cshtml";
}
@*<link href="~/Content/admin/jquery-ui.css" rel="stylesheet" />*@
<link rel="stylesheet" href="~/Content/admin/admin_edit.css" type="text/css" media="screen" />
<script src="~/Plugin/ckfinder/ckfinder.js"></script>
<script src="~/Plugin/ckeditor/ckeditor.js"></script>



@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    <article class="module width_full">
        <header>
            <h3>Edit Article</h3>
        </header>
        <div class="module_content">
            @Html.HiddenFor(model => model.ArticleID)
            <fieldset>
                <div class="title">Title</div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Title)
                    @Html.ValidationMessageFor(model => model.Title)
                </div>
            </fieldset>
            <fieldset>
                <div class="title">Alias</div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Alias)
                    @Html.ValidationMessageFor(model => model.Alias)
                </div>
            </fieldset>
            <fieldset>
                <div class="editor-label">
                    <div class="title">Intro Text</div>
                </div>
                <div class="editor-field">
                    @Html.TextAreaFor(c => c.IntroText, new { id = "ckeIntro", @rows = 10 })

                </div>
            </fieldset>
            <fieldset>
                <div class="title">Content</div>
                <div>
                    @Html.TextAreaFor(c => c.FullText)
                    @*FullText thanh id cho textArea*@
                </div>

            </fieldset>
            <fieldset class="width_fieldset_left">
                <div class="editor-label">
                    <div class="title">Create by</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.CreatedBy, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.CreatedBy)
                </div>
            </fieldset>
            <fieldset class="width_fieldset_right">
                <div class="editor-label">
                    <div class="title">Create Date</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.CreatedDate, new { @class = "width_field", @id = "datepicker" })
                    @Html.ValidationMessageFor(model => model.CreatedDate)


                </div>

            </fieldset>

            <fieldset class="width_fieldset_left">
                <div class="editor-label">
                    <div class="title">Modified By</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.ModifiedBy, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.ModifiedBy)
                </div>
            </fieldset>
            <fieldset class="width_fieldset_right">
                <div class="editor-label">
                    <div class="title">Modified Date</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.ModifiedDate, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.ModifiedDate)
                </div>
            </fieldset>

            <fieldset class="width_fieldset_left">
                <!-- to make two field float next to one another, adjust values accordingly -->
                <div class="title">Cateogory</div>
                <div class="editor-field">
                    @Html.DropDownListFor(c => c.Category, (IEnumerable<SelectListItem>)ViewBag.CategoryID, new { @class = "dropdown" })
                    @Html.ValidationMessageFor(model => model.CategoryID)
                </div>

            </fieldset>
            <fieldset class="width_fieldset_right">
                <div class="editor-label">
                    <div class="title">Meta Key</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.MetaKey, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.MetaKey)
                </div>
            </fieldset>

            <fieldset class="width_fieldset_left">
                <div class="editor-label">
                    <div class="title">Created By Alia </div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.CreatedByAlias, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.CreatedByAlias)
                </div>
            </fieldset>
            <fieldset class="width_fieldset_right">
                <div class="editor-label">
                    <div class="title">Image</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Image, new { @class = "width_field_img", @id = "txtImage" })
                    @Html.ValidationMessageFor(model => model.Image)
                    <input type="button" id="btnImage" name="btnImage" value="Brower" />
                </div>
            </fieldset>

            <fieldset class="width_fieldset_left">
                <div class="editor-label">
                    <div class="title">Hits</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Hits, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.Hits)
                </div>
            </fieldset>
            <fieldset class="width_fieldset_right">
                <div class="editor-label">
                    <div class="title">Meta Desc</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.MetaDesc, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.MetaDesc)
                </div>
            </fieldset>

            <fieldset class="width_fieldset_left">
                <div class="editor-label">
                    <div class="title">State</div>
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.State, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.State)
                </div>
            </fieldset>
            <fieldset class="width_fieldset_right">
                <div class="editor-label">
                    <div class="title">Checkout By</div>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.CheckoutBy, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.CheckoutBy)
                </div>
            </fieldset>
            <fieldset class="clear">
                <div class="editor-label">
                    @Html.LabelFor(model => model.CheckoutDate)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.CheckoutDate, new { @class = "width_field" })
                    @Html.ValidationMessageFor(model => model.CheckoutDate)
                </div>
            </fieldset>
            <div class="clear"></div>
        </div>

        <footer>
            <div class="submit_link">
                Published:
                @Html.EditorFor(model => model.Published, new { @class = "width_field" })
                <input type="submit" value="Save" class="alt_btn">
                <input type="submit" value="Reset">
            </div>
        </footer>
    </article>
    
}
<div class="spacer"></div>
<script type="text/javascript">
    CKEDITOR.replace("FullText");
</script>
<script type="text/javascript">
    $(function () {
        $("#btnImage").click(function () {
            var finder = new CKFinder();
            finder.selectt
            finder.selectActionFunction = function (fileUrl) {
                $('#txtImage').val(fileUrl);
            };
            finder.popup();

        });
    });
</script>
<script>
    $(function () {
        $("#datepicker").datetimerpicker();
    });
</script>
